<?php

namespace App\Http\Controllers\Api\WeChat;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Log;
use Session;

class UserController extends Controller
{
    public function login(Request $request){

        $data = $request->all();


        $app = app('wechat.mini_program');

        return $app->auth->session($data['code']);
    	// // dd($request->header());
    	// // return $request->header();
    	// Log::info($request->header());
    	
    	// if(Session::has('testSession')){
    	// 	Log::info('拥有session');
    	// 	return Session::get('testSession');
    	// }
    	// else{
    	// 	Log::error('无session');
    	// 	Session::put('testSession','This is test session');
    	// 	return Session::get('testSession');
    	// }
    	// return formatJsonResponse();
    }

   	public function getCodeObtainUserInfo(Request $request){
   		
   	}
}
